Skip to content

[CI] Fix detecting usage of private emails #19394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2025
Merged

Conversation

uditagarwal97
Copy link
Contributor

@uditagarwal97 uditagarwal97 commented Jul 10, 2025

fixes #17675

Currently, in the workflow, we only check the email that was used for the latest commit in the PR. This email can differ from the email settings on the GH UI, from which PR will be authored, once we merge it.

@uditagarwal97 uditagarwal97 changed the title typo [CI] Fix detecting usage of private emails Jul 10, 2025
@uditagarwal97 uditagarwal97 self-assigned this Jul 10, 2025
@uditagarwal97 uditagarwal97 reopened this Jul 10, 2025
@uditagarwal97 uditagarwal97 force-pushed the private/udit/email_test branch from 5bb431a to 178d1e6 Compare July 10, 2025 19:23
@uditagarwal97 uditagarwal97 reopened this Jul 10, 2025
@uditagarwal97 uditagarwal97 reopened this Jul 10, 2025
Copy link
Contributor

⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
Please turn off Keep my email addresses private setting in your account.
See LLVM Discourse for more information.

@uditagarwal97 uditagarwal97 force-pushed the private/udit/email_test branch from 1c31737 to 93b0594 Compare July 10, 2025 22:04
@uditagarwal97 uditagarwal97 marked this pull request as ready for review July 10, 2025 22:15
@uditagarwal97 uditagarwal97 requested a review from a team as a code owner July 10, 2025 22:15
@uditagarwal97
Copy link
Contributor Author

PS:- the "private email" workflow is failing in the precommit because I've made my email hidden in the GH profile. To demonstrate the changes made in this PR>

… Github UI (#148694)

**Problem**
Currently, the email check workflow uses `git` to see email used for the
last commit but the email address used when merging is actually governed
by GitHub settings not what's stored in `git`. Due to this, the email
check workflow passes even when the author's email is private in Github.
We saw several such cases in our fork of llvm. See
#17675

**Solution**
Try to find user's email using GH's GraphQL APIs. User's email will be
null if it's hidden in the profile.

---------

Signed-off-by: Agarwal, Udit <[email protected]>
@uditagarwal97 uditagarwal97 force-pushed the private/udit/email_test branch from 93b0594 to df8156a Compare July 16, 2025 17:25
@uditagarwal97 uditagarwal97 marked this pull request as ready for review July 16, 2025 17:26
@uditagarwal97 uditagarwal97 requested a review from sarnex July 16, 2025 17:26
@@ -39,6 +55,9 @@ jobs:
[{"body" : "$COMMENT"}]
EOF

# Fail this job.
false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we have this part upstream? or they didnt want it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's not a part of upstream as of now. But, as per llvm/llvm-project#148694 (comment), I'll be making a separate PR to make the workflow fail in the upstream.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, thanks

@uditagarwal97
Copy link
Contributor Author

@sarnex I've re-worked the fix based on the feedback I got from the community. The fix in this PR now cherry-picks llvm/llvm-project#148694 and makes the workflow fail when private email is used.

I'm working on a separate PR to make the workflow fail in upstream (based on llvm/llvm-project#148694 (comment)), but I suppose that will take some time, so in the meanwhile we can have the fix in intel/llvm atleast.

@sarnex sarnex merged commit efe5a5b into sycl Jul 16, 2025
11 of 12 checks passed
@uditagarwal97 uditagarwal97 deleted the private/udit/email_test branch July 16, 2025 17:32
uditagarwal97 added a commit that referenced this pull request Jul 16, 2025
uditagarwal97 added a commit that referenced this pull request Jul 16, 2025
Reverts #19394 sadly.

The workflow is failing if user's email is not listed publicly on your
GH profile. This is different from not having your email public on
Github (in Github email settings page vs. email field in Github
profile/email settings).

Reverting this PR till I figure out a fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] Email check is not functioning correctly
2 participants